// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';

// 引入element UI;
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
// 使用element UI
Vue.use(ElementUI);

import { Modal, Button, Radio } from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css'; // or 'ant-design-vue/dist/antd.less'
Vue.use(Modal).use(Button).use(Radio);

// 引入路由
import router from './router';
// 引入状态管理
import store from './vuex';

// 引入icon
// import './assets/icon/iconfont.css'

import '@/assets/css/base.css';
import '@/assets/css/main.scss';

//引入echarts
import * as echarts from 'echarts';
//挂载到Vue实例上，方便全局使用
Vue.prototype.echarts = echarts;

import axios from 'axios';
import Qs from 'qs';
Vue.prototype.axios = axios;
Vue.prototype.qs = Qs;
axios.defaults.withCredentials = true;//  允许跨域携带cookie信息


// 使用base64加密解密
// 加密 let encPass = this.$Base64.encode(password);  // 加密
// 解密 let decPass = this.$Base64.decode(encPass);   // 解密
import { Base64 } from 'js-base64';
Vue.prototype.$Base64 = Base64;

// 引入bootstrap
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap-vue/dist/bootstrap-vue.css';
import BootstrapVue from 'bootstrap-vue';
Vue.use(BootstrapVue);
// import 'default-passive-events';

// 过滤器
import * as custom from './utils/util';
Object.keys(custom).forEach(key => {
  Vue.filter(key, custom[key]);
})

// 注册请求接口
import http from './api/index';
Vue.prototype.$http = http;

// 使用路由拦截器
// import '@/router/permission.js';

Vue.config.productionTip = false;

import "default-passive-events";  // 解决Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  axios,
  store, // 使用store vuex状态管理
  components: { App },
  template: '<App/>',
  data: {
    // 空的实例放到根组件下，所有的子组件都能调用
    Bus: new Vue()
  }
})
